package com.rampage.entity;

/**
 * 返回结果
 */
public class Result<T> {
    public static int STATE_SUCCESS = 0;
    public static int STATE_FAILD = 1;
    public static int STATE_PERMISSION_UNDEFIND = 1000;//controller沒有启用 save load delete等方法时的允许错误
    public static int STATE_NO_LOGIN = 900;//还没登陆
    public static int STATE_USER_NOT_EXIST = 11;//用户不存在
    public static int STATE_PASSWORD_NOT_MATCH = 13;//密码不对
    public static int STATE_CONTENT_TYPE_ERROR = 14;//上传的类型不允许

    private int state;
    private String message;
    private T data;

    public Result(){

    };

    public Result(int state) {
        this.state = state;
    }

    public Result(int state, T data) {
        this.state = state;
        this.data = data;
    }

    public Result(int state, String message, T data) {
        this.state = state;
        this.message = message;
        this.data = data;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
